package com.xpc.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xpc.pojo.vo.StudentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * Project：UniversityGradeAdministrationSystem
 * Date：2022/5/23
 * Time：15:48
 * Description：TODO
 *
 * @author 南北辰的键盘
 * @version 1.0
 */
@Mapper
public interface StudentInfoMapper extends BaseMapper<StudentInfo> {

//    /**
//     *
//     *  查询学生信息
//     *
//     * @param page 分页对象
//     * @param wrapper
//     * @return
//     */

    /**
     *
     * 查询学生信息
     *
     * @return
     */
    @Select("SELECT a.account_id no, u.name,u.gender sex, s.grade, timestampdiff(year ,s.date,now()) age, m.name major, s.id_cdoe personID, c.name myClass, s.phone, s.dorm dormitoryNo FROM ctas.student s,ctas.user u,ctas.account a,ctas.major m,ctas.class c WHERE s.user_id = u.user_id and u.user_id = a.user_id and m.id = s.major_id and c.id = s.class_id;")
//    List<StudentInfo> selectStudentInfo(Page page,Wrapper wrapper);
    List<StudentInfo> selectStudentInfo();
//    IPage<StudentInfo> selectStudentInfo();
//    Page<StudentInfo> selectStudentInfo(IPage<StudentInfo> page, @Param(Constants.WRAPPER) Wrapper<StudentInfo> wrapper);


}
